﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FindHospital.aspx.cs" Inherits="HZ.Supervise.Web.Common.FindHospital" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>选择地区</title>
    <link rel="stylesheet" type="text/css" href="../style/global.css" />

    <script type="text/javascript" src="../scripts/jquery.js"></script>

    <script type="text/javascript" src="../scripts/mainlistSelect.js"></script>

    <script type="text/javascript" src="../scripts/Common.js"></script>

    <script type="text/javascript" src="../scripts/global.js"></script>

    <script type="text/javascript" language="javascript">
//        function addAreaInfo() {
//            if (!checkSelectedItems('gvwAreaList', '请至少选择一项！')) {
//                return false;
//            }
//            CheckBoxList = document.getElementsByName("chkArea");
//            var hosIDs = "";
//            var hosNames = "";
//            for (var i = 0; i < CheckBoxList.length; i++) {
//                if (CheckBoxList[i].checked) {
//                    resultValue = CheckBoxList[i].value;
//                    tempId = resultValue.split("|")[0];
//                    tempName = resultValue.split("|")[1];

//                    hosIDs = hosIDs + tempId + ",";
//                    hosNames = hosNames + tempName + ",";
//                }
//            }
//            var AreaInfo;
//            AreaInfo = hosNames + "|" + hosIDs + "|" + document.getElementById("chkAllArea").checked;
//            opener.insertAreaInfo(AreaInfo);
//            window.close();
//        }

        function addHosInfo(str) {
//            var hosInfo;
            //            hosInfo = id + "|" + name;   //document.getElementById("HosName").value + "|" + document.getElementById("HosId").value;
//           //alert(str);
//            opener.insertHosInfo(str);
//            window.close();
            window.parent.insertHosInfo(str);
            window.parent.hidePopWin(false);
        }
//        function chkAllCompany() {
//            CheckBoxList = document.getElementsByName("chkArea");
//            for (var i = 0; i < CheckBoxList.length; i++) {
//                CheckBoxList[i].checked = true;
//            }
//        }


//        function insertCompanyInfo() {



//            var resultValue = "";



//            var listbox = document.getElementById("ListArea");
//            var hosID = document.getElementById("AreaId");
//            var hosName = document.getElementById("AreaName");
//            var arrayName = hosNames.split(',');
//            var arrayID = hosIDs.split(',');
//            var isUnique = true;
//            var temp;
//            for (m = 0; m < arrayID.length; m++) {
//                for (n = 0; n < listbox.options.length; n++) {
//                    if (arrayID[m] == listbox.options[n].value) {
//                        isUnique = false;
//                        temp = arrayName[m];
//                        break;
//                    }
//                }
//            }

//            if (isUnique == true) {
//                for (var i = 0; i < arrayName.length; i++) {
//                    if (!isNull(arrayName[i])) {
//                        var listItem = document.createElement("OPTION");
//                        listItem.text = arrayName[i];
//                        listItem.value = arrayID[i];
//                        listbox.add(listItem);
//                    }
//                }
//            }
//            else {
//                alert("地区" + temp + "已经存在！");
//                return;
//            }
//            hosID.value = "";
//            hosName.value = "";
//            for (j = listbox.options.length - 1; j >= 0; j--) {
//                hosID.value += listbox[j].value + ",";
//                hosName.value += listbox[j].text + ",";
//            }
//        }


//        function isNull(str) {
//            var re = /^[ \s]*$/;
//            return re.test(str);
//        }
    </script>

    <style type="text/css">
        .style1
        {
            width: 40%;
        }
    </style>

</head>
<body>
    <form id="form1" runat="server">
    <input id="AreaName" type="hidden" name="HosName" runat="server" />
    <input id="AreaId" type="hidden" name="HosId" runat="server" />
    <table class="querylist">
        <tr>
        <td class="style1">
            <asp:Label ID="lblQueryCondition" runat="server" Text="医院名称："></asp:Label>
            <asp:TextBox ID="txtHosName" runat="server"></asp:TextBox>
            <hz:HzButton ID="btnQery" runat="server" Text="查询" CssClass="btn" Width="50px" OnClick="btnQery_Click" />
            </td>
        </tr>
        <tr>
            <td class="style1">
                选择医院：
            </td>
        </tr>
        <tr>
            <td class="style1">
                <asp:GridView ID="gvwHosList" runat="server" CssClass="mainlist" AutoGenerateColumns="False"
                    DataKeyNames="HospitalID" EmptyDataText="暂无符合条件的数据！">
                    <Columns>
                        <%-- <asp:TemplateField>
                        <HeaderTemplate>
                            <input id="chkAllArea" name="chkAllArea" type="checkbox" onclick="SelectAllCheckboxes(this,'gvwAreaList','chkAllArea');" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <input id="chkArea" name="chkArea" type="checkbox" onclick="chkChecked(this,'gvwAreaList','chkAllArea');"
                                value='<%# Eval("AreaID") %>|<%# Eval("AreaName") %>'> </input>
                        </ItemTemplate>
                    </asp:TemplateField>--%>
                        <asp:TemplateField HeaderText="医院名称">
                            <ItemTemplate>
                                <a  href="javascript:addHosInfo('<%# Eval("HospitalID") %>|<%# Eval("HospitalName")%>')"> <%# Eval("HospitalName") %></a>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Left" />
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            
            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" CustomInfoHTML="" 
                CustomInfoStyle="display:none" NumericButtonCount="5" 
                onpagechanged="AspNetPager1_PageChanged" ReverseUrlPageIndex="false" 
                ShowDisabledButtons="False" ShowFirstLast="False" ShowMoreButtons="false" 
                ShowPageSizeBox="false" ShowPrevNext="False" PageSize="20">
            </webdiyer:AspNetPager>
            
            </td>
        </tr>
        <tr>
            <td class="style1">
                <input type="button" id="btnOk" value="确认" class="btn" onclick="return addHosInfo('|');" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
